﻿
@{
    ViewBag.Title = "EmployeePageList";
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}
@section css{
    <link href="~/Assets/css/lib/bootstrap-select.css" rel="stylesheet" />
    <style>
        .bg-light th {
            font-weight: bolder;
            text-align: center;
        }
    </style>
}
<header id="topbar">
    <div class="topbar-left">
        <ol class="breadcrumb">
            <li class="crumb-active">
                <a>用户列表</a>
            </li>
            <li class="crumb-trail">用户管理</li>
        </ol>
    </div>
</header>
<section id="content" class="animated fadeIn" ng-cloak ng-controller="SystemConfigController" ng-init="SearchModel={};page='@(Request.QueryString["page"].IsEmpty() ? "1" : Request.QueryString["page"])';
   page='@(Request.QueryString["page"].IsEmpty() ? "1" : Request.QueryString["page"])';
         SearchModel={};
     BindDepartmentList('Dep_Select');
         GetUserPageList(SearchModel,page);">

    <div class="load" ng-show="DataLoading">
        <div class="loader">
            <svg version="1.1" id="loader-1" x="0px" y="0px" width="100px" height="100px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
            <path fill="#000" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">
            <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite" />
			</path>
		</svg>
            <div class="load-msg" ng-bind="LoadingMsg"></div>
        </div>
    </div>
    <form class="form-horizontal">
        <div class="panel">
            <div class="panel-heading">
                <span class="panel-title">
                    <span class="glyphicons glyphicons-filter"></span>搜索过滤
                </span>
            </div>
            <div class="panel-body fill">
                <div class="row">
                    <div class="form-group">
                        <div class="col-md-2">
                            <input type="text" class="form-control" placeholder="工号" ng-model="SearchModel.UserNo" ng-change="GetUserPageList(SearchModel,1);" />
                        </div>

                        <div class="col-md-2">
                            <input type="text" class="form-control" placeholder="用户名" ng-model="SearchModel.UserName" ng-change="GetUserPageList(SearchModel,1);" />
                        </div>

                        <label class="col-sm-1 control-label">所在部门：</label>
                        <div class="col-sm-2">
                            <select id="Dep_Select" class="selectpicker show-tick form-control" ng-model="SearchModel.DepartmentId" ng-change="GetUserPageList(SearchModel,1);" data-live-search="true">
                                <option value="" selected>所有部门</option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="panel panel-info">
            <div class="panel-heading">
                <span class="panel-title">
                    <span class="glyphicons glyphicons-list"></span>用户列表 总数：{{TotalCount}}
                </span>
                <div class="widget-menu pull-right mr10">
                    <div class="btn-group">
                        @*<a ng-if="@ViewBag.IsAdd==1" href="UserAdd?page={{result.currentPage}}" class="btn btn-xs btn-inverse"><i class="fa fa-plus"></i>添加用户</a>*@
                        <a  href="UserAdd?page={{result.currentPage}}" class="btn btn-xs btn-inverse" style="color:white;"><i class="fa fa-plus"></i>添加用户</a>
                    </div>
                </div>
            </div>
            <div class="panel-body">
                <table class="table table-striped table-bordered" ng-show="!PageLoading">
                    <thead>
                        <tr>
                            <th style="width:3%">序号</th>                                        
                            <th style="width:5%">工号</th>
                            <th style="width:10%">用户名</th>
                            <th style="width:10%">部门</th>
                            <th style="width:15%">联系方式</th>
                            <th style="width:15%">邮箱</th>
                            <th style="width:15%">角色</th>
                            <th style="width:20%">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr ng-show="UserList==null || UserList.length==0">
                            <td colspan="8" style="text-align:center;vertical-align:middle;line-height:30px;">没有数据</td>
                        </tr>
                        <tr ng-repeat="x in UserList" ng-show="UserList!=null && UserList.length>0">
                            <td ng-bind="$index+1"></td>
                            <td ng-bind="x.UserNo"></td>
                            <td ng-bind="x.UserName"></td>
                            <td ng-bind="x.DepartmentName"></td>
                            <td ng-bind="x.Phone"></td>
                            <td ng-bind="x.Email"></td>
                            <td ng-bind="x.RoleName"></td>
                            <td>
                                @*<a ng-if="@ViewBag.IsModify==1" href="UserRoleEdit?Id={{x.UserId}}&page={{result.currentPage}}" class="btn btn-success btn-xs btn-label"><i class="fa fa-users"></i>角色配置</a>
        <a ng-if="@ViewBag.IsModify==1" href="UserEdit?Id={{x.UserId}}&page={{result.currentPage}}" class="btn btn-warning btn-xs btn-label"><i class="fa fa-pencil"></i>编辑</a>
        <a ng-if="@ViewBag.IsDelete==1" ng-click="DeleteUserInfo(x.UserId,x.UserNo,result.currentPage);" class="btn btn-danger btn-xs btn-label"><i class="fa fa-trash-o"></i>删除</a>*@
                                <a href="UserRoleEdit?Id={{x.UserId}}&page={{result.currentPage}}" class="btn btn-success btn-xs btn-label"><i class="fa fa-users"></i>角色配置</a>
                                <a ng-show="@ViewBag.IsEdit==1" ng-click="ResetPassword(x.UserId);" class="btn btn-info btn-xs btn-label"><i class="fa fa-lock"></i>密码重置</a>
                                <a href="UserEdit?Id={{x.UserId}}&page={{result.currentPage}}" class="btn btn-warning btn-xs btn-label"><i class="fa fa-pencil"></i>编辑</a>
                                <a ng-click="DeleteUserInfo(x.UserId,x.UserNo,result.currentPage);" class="btn btn-danger btn-xs btn-label"><i class="fa fa-trash-o"></i>删除</a>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>

        </div>
        <div class="text-center" ng-show="UserList!=null && UserList.length>0">
            <ul class="pagination  justify-content-center">
                <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetUserPageList(SearchModel,1);">首页</a></li>
                <li class="page-item" ng-class="{'active':result.currentPage==page}" ng-repeat="page in result.pages"><a style="cursor:pointer;" ng-click="GetUserPageList(SearchModel,page)" class="page-link" ng-bind="page"></a></li>
                <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetUserPageList(SearchModel,(result.currentPage + 1 > result.totalPage ? result.totalPage : result.currentPage + 1))">下一页</a></li>
                <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetUserPageList(SearchModel,result.totalPage);">尾页</a></li>
            </ul>
        </div>


    </form>




</section>

@section Js{
    <script src="~/bussiness/js/pg/Organization.js?v=@DateTime.Now.ToString("yyMMddHHmm")"></script>
    <script src="~/bussiness/js/libs/moment.min.js"></script>
    <script src="~/bussiness/js/libs/locales/date/zh-cn.js"></script>
    <script src="~/bussiness/js/libs/bootstrap-datetimepicker.min.js"></script>
    <script src="~/bussiness/js/libs/angularjs-datepicker.js"></script>
    <script src="~/bussiness/js/libs/fileinput.js"></script>
    <script src="~/bussiness/js/libs/zh.js"></script>
}
